home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 April: Mac OS SDK / Dev.CD Apr 96 SDK / Dev.CD Apr 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc Development Framework / ODFDev / ODF / Examples / Draw / Include / LineShp.h < prev    next >
Encoding:
Text File  |  1995-11-08  |  3.2 KB  |  117 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                LineShp.h
  4. //    Release Version:    $ 1.0d11 $
  5. //
  6. //    Author:                Henri Lamiraux
  7. //
  8. //    Copyright:    © 1993, 1995 by Apple Computer, Inc., all rights reserved.
  9. //
  10. //========================================================================================
  11.  
  12. #ifndef LINESHP_H
  13. #define LINESHP_H
  14.  
  15. #ifndef CONSTANT_H
  16. #include "Constant.h"
  17. #endif
  18.  
  19. #ifndef BASESHP_H
  20. #include "BaseShp.h"
  21. #endif
  22.  
  23. // ----- OS Layer -----
  24.  
  25. #ifndef FWPOINT_H
  26. #include "FWPoint.h"
  27. #endif
  28.  
  29. #ifndef FWRECT_H
  30. #include "FWRect.h"
  31. #endif
  32.  
  33. // ----- Foundation Layer -----
  34.  
  35. #ifndef FWRUNTYP_H
  36. #include "FWRunTyp.h"
  37. #endif
  38.  
  39. //========================================================================================
  40. // Forward Declarations
  41. //========================================================================================
  42.  
  43. #if FW_LIB_EXPORT_PRAGMAS
  44. #pragma import on
  45. #endif
  46. /*class FW_CLASS_ATTR ODFacet;
  47. class FW_CLASS_ATTR ODShape;
  48. class FW_CLASS_ATTR CDrawPart;
  49. class FW_CLASS_ATTR CDrawPublishLink;
  50. class FW_CLASS_ATTR CDrawSubscribeLink;
  51. class FW_CLASS_ATTR FW_CGraphicContext;
  52. class FW_CLASS_ATTR FW_CMouseEvent;
  53. class FW_CLASS_ATTR FW_CRectShape;*/
  54. #if FW_LIB_EXPORT_PRAGMAS
  55. #pragma import off
  56. #endif
  57.  
  58. //class FW_CLASS_ATTR CDrawFacetClipper;
  59.  
  60. //========================================================================================
  61. // class CLineShape
  62. //========================================================================================
  63.  
  64. class FW_CLASS_ATTR CLineShape : public CBaseShape
  65. {
  66. public:
  67.     FW_DECLARE_CLASS
  68.  
  69. public:
  70.     CLineShape();
  71.     CLineShape(FW_CReadableStream& archive);
  72.     virtual ~CLineShape();
  73.         
  74.     // ----- Geometry
  75.     virtual void        SetShapeGeometry(const FW_CPoint& anchorPoint,  const FW_CPoint& currentPoint);
  76.     virtual ODShape*    CreateShapeOutline(Environment *ev);
  77.     virtual void        GetClipRegion(Environment* ev, ODShape* clipRegion);
  78.     virtual void        GetRectGeometry(FW_CRect& bounds) const;
  79.     
  80.     FW_CPoint            GetLineStart() const
  81.                             {return fStart;}
  82.     FW_CPoint            GetLineEnd() const
  83.                             {return fEnd;}
  84.                             
  85.     // ----- Selection
  86.     virtual FW_Boolean    HitTest(Environment *ev, FW_CGraphicContext& gc, const FW_CMouseEvent& theMouseEvent) const;
  87.     
  88.     // ----- Dragging
  89.     virtual void        OffsetShape(Environment *ev, FW_CFixed xDelta, FW_CFixed yDelta);
  90.  
  91.     // ----- Resize
  92.     virtual void        ResizeFeedback(FW_CGraphicContext& gc, const FW_PInk& ink, const FW_PStyle& style, 
  93.                                         short whichHandle, const FW_CPoint& mouseLoc);
  94.     virtual void        GetMapRects(short whichHandle, const FW_CPoint& lastLocation,
  95.                                     FW_CRect& srcRect, FW_CRect& dstRect);
  96.     virtual void        GetHandleCenter(short whichHandle, FW_CPoint& center) const;
  97.     virtual void        MapShape(Environment *ev, CDrawPart* part, const FW_CRect& srcRect, const FW_CRect& dstRect);
  98.     
  99.     // ----- Drawing
  100.     virtual void         RenderShape(Environment* ev, ODFacet* facet, FW_CGraphicContext& gc);
  101.  
  102.     // ----- Persistence
  103.     virtual void         Flatten(FW_CWritableStream& archive);
  104.     
  105.     // ----- Archiving -----
  106.     static void*         Read(FW_CReadableStream& archive);
  107.  
  108. private:
  109.     void                 OutlineShape(FW_CGraphicContext& gc, const FW_PInk& ink, const FW_PStyle& style, 
  110.                                      const FW_CPoint& pt1, const FW_CPoint& pt2);
  111.  
  112. private:
  113.     FW_CPoint            fStart;
  114.     FW_CPoint            fEnd;
  115. };
  116.  
  117. #endif